unit Class_Memb;

interface
uses
  Classes,SysUtils,Uni,UniEngine;

type
  TMemb=class(TUniEngine)
  public
    UnitLink:string;
    MembIdex:Integer;
    MembName:string;
  protected
    procedure SetParameters;override;
    function  GetStrInsert:string;override;
    function  GetStrUpdate:string;override;
    function  GetStrDelete:string;override;
    function  GetStrsIndex:string;override;
  public
    function  GetNextIdex:Integer;overload;
    function  GetNextIdex(AUniConnection:TUniConnection):Integer;overload;
  public
    function  CheckExist(AUniConnection:TUniConnection):Boolean;override;
  public
    class function ReadDS(AUniQuery:TUniQuery):TUniEngine;override;    
  end;

implementation

{ TMemb }

function TMemb.CheckExist(AUniConnection: TUniConnection): Boolean;
begin

end;

function TMemb.GetNextIdex: Integer;
begin

end;

function TMemb.GetNextIdex(AUniConnection: TUniConnection): Integer;
begin

end;

function TMemb.GetStrDelete: string;
begin

end;

function TMemb.GetStrInsert: string;
begin

end;

function TMemb.GetStrsIndex: string;
begin
  Result:=Format('%S-%D',[UnitLink,MembIdex]);
end;

function TMemb.GetStrUpdate: string;
begin

end;

class function TMemb.ReadDS(AUniQuery: TUniQuery): TUniEngine;
begin
  Result:=TMemb.Create;
  with TMemb(Result) do
  begin
    UnitLink:=AUniQuery.FieldByName('Unit_Link').AsString;
    MembName:=AUniQuery.FieldByName('memb_name').AsString;
    MembIdex:=AUniQuery.FieldByName('memb_idex').AsInteger;
  end;  
end;

procedure TMemb.SetParameters;
begin
  inherited;
  {with FUniSQL.Params do
  begin
    case FOptTyp of
      otAddx:
      begin
        ParamByName('UNIX_IDEX').Value := UnitLink;
        ParamByName('UNIX_STAT').Value := UNIXSTAT;
        ParamByName('UNIX_YEAR').Value := UNIXYEAR;
      end;
      otEdit:
      begin
        ParamByName('UNIX_IDEX').Value := UnitLink;
        ParamByName('UNIX_STAT').Value := UNIXSTAT;
        ParamByName('UNIX_YEAR').Value := UNIXYEAR;
      end;  
      otDelt:
      begin
        ParamByName('UNIX_IDEX').Value := UnitLink;
      end;  
    end;
  end;}
end;

end.
